const router = require('koa-router')()
const { list } = require('../controllers/approve.js')
const { approve } = require('../controllers/approve.js')

router.prefix('/approve')
// .get('/:type/list')     不利于维护，过多处理非法type
.get('/first/list', list.first)
.get('/end/list', list.end)
.post('/first/pass', approve.first.pass)
.post('/first/reject', approve.first.reject)
.post('/end/pass', approve.end.pass)
.post('/end/reject', approve.end.reject)

module.exports = router